class Solution {
public:
    int minimumCost(vector<int>& cost) {
        sort(cost.begin(), cost.end(), greater<int>());
        int cnt = 0;
        for (int i = 1; i <= cost.size(); i ++ ) {
            if (i % 3 == 0) continue;
            else cnt += cost[i - 1];
        }
        return cnt;
    }
};
